from django.contrib import admin
from user.models import *
import xadmin

class UserAdmin(object):
	list_display = ('nickname', 'sex', 'city', 'subscribe_time', 'phonenumber')
	search_fields = ('nickname', 'phonenumber')
	list_filter = ('sex', 'subscribe_time')
	date_hierarchy = ('subscribe_time', )   # 详细时间分层筛选


class BorrowAdmin(object):
	list_display = ('user', 'book', 'borrow_time', 'return_time', 'status')
	pass


class BookBillAdmin(object):
	list_display = ('user', 'book')
	pass


xadmin.site.register(User, UserAdmin)
xadmin.site.register(Borrow, BorrowAdmin)
xadmin.site.register(BookBill, BookBillAdmin)